<template>
  <ul class="tab">
    <li class="tab-item" v-for="item in title" :key="item.id">{{item.name}}</li>
  </ul>
</template>

<script>
export default {
  data () {
    return {
      title: [
        {
          id: 1,
          name: '推荐'
        },
        {
          id: 2,
          name: '歌手'
        },
        {
          id: 3,
          name: '排行'
        },
        {
          id: 4,
          name: '搜索'
        }
      ]
    }
  }
}
</script>

<style lang="scss" scoped>
.tab {
  display: flex;
  height: 44px;
  line-height: 44px;
  font-size: $font-size-medium;

  .tab-item {
    flex: 1;
    text-align: center;

    .tab-link {
      padding-bottom: 5px;
      color: $color-text-l;
    }

    &.router-link-active {
      .tab-link {
        color: $color-theme;
        border-bottom: 2px solid $color-theme;
      }
    }
  }
}
</style>
